package com.fr.chart.plot;

import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.chart.base.equals.Equals;
import com.fr.chart.core.glyph.Area3DPlotGlyph;
import com.fr.chart.core.glyph.AreaCategory3DAxisGlyph;
import com.fr.chart.core.glyph.CategoryAxisGlyph;
import com.fr.chart.core.glyph.DateAxis3DGlyph;
import com.fr.chart.core.glyph.PlotGlyph;
import com.fr.chart.core.glyph.ValueAxis3DGlyph;
import com.fr.chart.core.glyph.ValueAxisGlyph;
import com.fr.chart.legend.LineMarkerIcon;
import com.fr.chart.math.Plot3D;
import com.fr.chart.math.Projection;
import com.fr.data.ChartData;

public class Area3DPlot extends CategoryPlot
  implements Plot3D
{
  private static final long serialVersionUID = -2168856417697999430L;
  private Projection projection = new Projection();
  private double seriesIntervalPercent = 1.0D;
  private int deep = -1;

  public PlotGlyph createPlotGlyph(ChartData paramChartData)
  {
    Area3DPlotGlyph localArea3DPlotGlyph = new Area3DPlotGlyph();
    install4PlotGlyph(localArea3DPlotGlyph, paramChartData);
    installAxisGlyph(localArea3DPlotGlyph, paramChartData);
    return localArea3DPlotGlyph;
  }

  public void install4PlotGlyph(Area3DPlotGlyph paramArea3DPlotGlyph, ChartData paramChartData)
  {
    super.install4PlotGlyph(paramArea3DPlotGlyph, paramChartData);
    paramArea3DPlotGlyph.setProjection(this.projection);
    paramArea3DPlotGlyph.setDeep(this.deep);
    paramArea3DPlotGlyph.setSeriesIntervalPercent(this.seriesIntervalPercent);
  }

  protected void dealCondition(LineMarkerIcon paramLineMarkerIcon, int paramInt)
  {
    dealColorCondition(paramLineMarkerIcon, paramInt);
  }

  public ValueAxisGlyph createValueAxisGlyph()
  {
    return new ValueAxis3DGlyph(this.valueAxis);
  }

  public CategoryAxisGlyph createCategoryAxisGlyph()
  {
    return new AreaCategory3DAxisGlyph(this.categoryAxis);
  }

  public CategoryAxisGlyph createDateAxisGlyph()
  {
    return new DateAxis3DGlyph(this.categoryAxis);
  }

  public void setProjection(Projection paramProjection)
  {
    this.projection = paramProjection;
  }

  public Projection getProjection()
  {
    return this.projection;
  }

  public void setDeep(int paramInt)
  {
    this.deep = paramInt;
  }

  public int getDeep()
  {
    return this.deep;
  }

  public void setSeriesIntervalPercent(double paramDouble)
  {
    this.seriesIntervalPercent = paramDouble;
  }

  public double getSeriesIntervalPercent()
  {
    return this.seriesIntervalPercent;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    super.readXML(paramXMLableReader);
    if (paramXMLableReader.isChildNode())
    {
      String str1 = paramXMLableReader.getTagName();
      if ("Projection".equals(str1))
      {
        this.projection = ((Projection)paramXMLableReader.readXMLObject(new Projection()));
      }
      else if ("Area3DAttr".equals(str1))
      {
        String str2;
        if ((str2 = paramXMLableReader.getAttr("seriesIntervalPercent")) != null)
          this.seriesIntervalPercent = Double.parseDouble(str2);
        if ((str2 = paramXMLableReader.getAttr("deep")) != null)
          this.deep = Integer.parseInt(str2);
      }
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("Plot");
    super.writeXML(paramXMLPrintWriter);
    paramXMLPrintWriter.startTAG("Area3DAttr").attr("seriesIntervalPercent", this.seriesIntervalPercent);
    if (this.deep != -1)
      paramXMLPrintWriter.attr("deep", this.deep);
    paramXMLPrintWriter.end();
    if (this.projection != null)
      this.projection.writeXML(paramXMLPrintWriter);
    paramXMLPrintWriter.end();
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    Area3DPlot localArea3DPlot = (Area3DPlot)super.clone();
    if (this.projection != null)
      localArea3DPlot.projection = ((Projection)this.projection.clone());
    return localArea3DPlot;
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof Area3DPlot))
      return false;
    Area3DPlot localArea3DPlot = (Area3DPlot)paramObject;
    if (!(super.equals(localArea3DPlot)))
      return false;
    if (localArea3DPlot.getDeep() != getDeep())
      return false;
    if (localArea3DPlot.getSeriesIntervalPercent() != getSeriesIntervalPercent())
      return false;
    return (Equals.equals(localArea3DPlot.projection, this.projection));
  }
}